#Boa:FramePanel:PanelOverdueRegion

import wx
from MyListCtrl import *

[wxID_PANELOVERDUEREGION, wxID_PANELOVERDUEREGIONBUTTONREFRESH, 
 wxID_PANELOVERDUEREGIONCHECKBOX1, wxID_PANELOVERDUEREGIONCOMBOBOXSALESMAN, 
 wxID_PANELOVERDUEREGIONSTATICTEXT1, 
] = [wx.NewId() for _init_ctrls in range(5)]

class PanelOverdueRegion(wx.Panel):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Panel.__init__(self, id=wxID_PANELOVERDUEREGION,
              name=u'PanelOverdueRegion', parent=prnt, pos=wx.Point(836, 556),
              size=wx.Size(587, 369), style=wx.TAB_TRAVERSAL)
        self.SetClientSize(wx.Size(571, 331))
        self.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD, False,
              u'\u6977\u4f53_GB2312'))
        self.SetBackgroundColour(wx.Colour(183, 209, 173))

        self.staticText1 = wx.StaticText(id=wxID_PANELOVERDUEREGIONSTATICTEXT1,
              label=u'\u8d1f\u8d23\u4eba\uff1a', name='staticText1',
              parent=self, pos=wx.Point(16, 16), size=wx.Size(68, 16), style=0)

        self.comboBoxSalesman = wx.ComboBox(choices=[],
              id=wxID_PANELOVERDUEREGIONCOMBOBOXSALESMAN,
              name=u'comboBoxSalesman', parent=self, pos=wx.Point(130, 8),
              size=wx.Size(150, 24), style=0, value=u'')
        self.comboBoxSalesman.SetLabel(u'')

        self.checkBox1 = wx.CheckBox(id=wxID_PANELOVERDUEREGIONCHECKBOX1,
              label=u'\u663e\u793a\u672a\u8fc7\u671f\u5730\u533a',
              name='checkBox1', parent=self, pos=wx.Point(312, 16),
              size=wx.Size(160, 16), style=0)
        self.checkBox1.SetValue(False)

        self.buttonRefresh = wx.Button(id=wxID_PANELOVERDUEREGIONBUTTONREFRESH,
              label=u'\u5237\u65b0', name=u'buttonRefresh', parent=self,
              pos=wx.Point(500, 8), size=wx.Size(93, 26), style=0)
        self.buttonRefresh.Bind(wx.EVT_BUTTON, self.OnButtonRefreshButton,
              id=wxID_PANELOVERDUEREGIONBUTTONREFRESH)

    def __init__(self, parent):
        self._init_ctrls(parent)

        self.lc = MyListCtrlOverdueRegion(self)
        self.lc.Move(wx.Point(10, 40))
        self.lc.SetSize(wx.Size(1000, 650))
        self.lc.refresh()

        self.cbPioneer = MyComboBoxDecorator(self.comboBoxSalesman, CDataStaff, CDataStaff.COL_NAME, only_enable_staff)
        self.cbPioneer.refresh()

    def OnButtonRefreshButton(self, event):
        filter = {}
        pioneerObj = self.cbPioneer.getSelectObj()
        if pioneerObj is not None:
            filter['salesman'] = pioneerObj.getValue(CDataStaff.COL_ID)
            
        filter['show_all'] = self.checkBox1.GetValue()
            
        self.lc.refresh(filter)
